extends Node2D

var water = 10
var current_select = ""
var current_button 
var current_coast = 0

func _ready():
	pass

func _on_WaterTimer_timeout():
	if water<10:
		water += 1
		$WaterShow.text = "圣水:" + str(water)
	pass

func _on_back_pressed():
	get_tree().paused = false
	get_tree().change_scene("res://scene/Main.tscn")
	pass

func _input(event):
#	if event is InputEventMouseButton and event.is_pressed():
#		if event.button_index == BUTTON_LEFT:
#			get_global_mouse_position()
#			#current_button.toggled = false
#			#current_select = ""
#			#water -= current_coast
#			#$WaterShow.text = "圣水:" + str(water)
	pass

func selected(p1,p2,p3):
	current_select = p1
	current_button = p2
	current_coast = p3


func _on_Place_input_event(viewport, event, shape_idx):
	print(event)
	if event is InputEventMouseButton:
		print_debug("place")
		if event.button_index == BUTTON_LEFT:
			if current_select == "火箭公主":
				var hjgz = load("res://obj/FirePeople.tscn").instance()
				get_tree().current_scene.add_child(hjgz)
				hjgz.position = event.position
	pass # Replace with function body.
